﻿@model Tuple<deviceManage.Models.DailyCheck>
@{
    ViewData["Title"] = "巡检记录";
}
<style>

    .layui-form-label {
        width: auto;
    }
    .editForm .layui-form-label {
        width: 70px;
    }
    .layui-form-item .layui-input-inline{
        width:138px;
    }
    .layui-input-inline.longInput {
        width: 350px;
    }

    .plan_month_ul {
        display: none;
        width: 430px;
        margin-top: 20px;
    }
    .plan_month_ul.active{
        display:block;
    }
    .plan_month_li {
        display: inline-block;
        width: 22px;
        text-align: center;
        cursor: pointer;
        margin-right: 10px;
        border: 1px solid #ddd;
    }

   .plan_month_li.active {
            background-color: #009688;
            color:white;
   }
    .layui-layout-body{
        overflow:auto;
    }
</style>
 
        <div class="layui-fluid" style="padding-bottom:85px;">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">基本信息</div>
                        <div class="layui-card-body" style="padding: 15px;">
                            <form class="layui-form editForm" action="" lay-filter="component-form-group">
                                <input type="hidden" name="id" id="id" value="@Model.Item1.Id" />
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">巡检日期</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="CheckDate" id="buyDate" readonly autocomplete="off" readonly
                                                   class="layui-input date" value="@if(Model.Item1.CheckDate != null){@Model.Item1.CheckDate.Value.ToString().Substring(0, 10); } ">
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">巡检人</label>
                                        <div class="layui-input-inline longInput">
                                            <input type="text" name="checkUser" readonly value="@Model.Item1.CheckUser" lay-verify="required" autocomplete="off" class="layui-input" maxlength="100">
                                        </div>
                                    </div>
                                </div>


                                <div class="layui-form-item" style="padding-bottom:50px;">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">备注信息</label>
                                        <div class="layui-input-inline longInput">
                                            <textarea name="remark" readonly style="height:200px;" placeholder="请输入" class="layui-textarea">@Model.Item1.Remark</textarea>
                                        </div>
                                    </div>
                                </div>

                                 
                            </form>
                        </div>
                    </div>
                   

                </div>
                <div class="layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">
                            机房列表
                             
                        </div>
                        <div class="layui-card-body" style="padding: 15px;">
                            <table class="layui-table layuiadmin-page-table" id="roomTable" lay-skin="line"></table>

                        </div>
                    </div>
                    <div class="layui-card">
                        <div class="layui-card-header">
                            损坏设备列表
                             
                        </div>
                        <div class="layui-card-body" style="padding: 15px;">
                            <table class="layui-table layuiadmin-page-table" id="deviceTable" lay-skin="line"></table>

                        </div>
                    </div>
                </div>

            </div>
        </div>
 
<script>

 

    function selectRoom() {
        $.get("/checkLog/SelectRoom?id=@Model.Item1.Id", function (str) {
            var index = window.parent.layer.open({
                type: 1,
                title: '添加机房',
                content: str //注意，如果str是object，那么需要字符拼接。
            });
            window.parent.currentWinIndex = index;
        });
    }

    //选择设备
    function selectDevice() {          
        $.get("/checkLog/selectDevice?id=@Model.Item1.Id", function (str) {
                var index = window.parent.layer.open({
                    type: 1,
                    area:["1000px","500px"],
                    title: '选择设备',
                    content: str //注意，如果str是object，那么需要字符拼接。
            });
  
         }); 
    }


    window.parent.checkId = "@Model.Item1.Id";
    
    //加载table
    var tableRoom = table.render({
        elem: '#roomTable'
        ,height:"140px"
        , url: '/checkLog/CheckRoomList?id=@Model.Item1.Id' //其他文件
            , cols: [[
                { field: 'name', title: '机房', templet: '<div> {{ d.room.name}}</div>' },
                { field: 'humidity', title: '湿度', templet: '<div> {{ d.humidity}}</div>' },
                { field: 'temperature', title: '温度', templet: '<div> {{ d.temperature}}</div>' },
                 
                ]]
        , skin: 'line'
    });
    window.parent.tableRoom = tableRoom;

     var tableDevice = table.render({
         elem: '#deviceTable'
         , height: "135px"
         , url: '/checkLog/badDeviceList?id=@Model.Item1.Id' //其他文件
            , cols: [[
                { field: 'name', title: '设备名称',width:180, templet: '<div>{{ d.device.name}}</div>' },                
                { field: 'deviceId', title: '设备编号', templet: '<div>{{ d.device.deviceId}}</div>' },
                { field: 'name', title: '说明', templet: '<div>{{ getString(d.remark)}}</div>' },
                 
                ]]
        , skin: 'line'
    });
    window.parent.tableDevice = tableDevice;
      
    //渲染form
    form.render(null, 'component-form-group');
     
</script>
